@echo off

REM SHA1 sums of files required
REM 9988723269367fb44ef83f627186a1c88cf7877e decoder.4
REM 30002643d08ed983a6701a7c4b5ee74a2f4a1adb decoder.6
REM 4d60942320c03ae50b0b17267062a321cf49e240 bubbles.1b
REM 2788c4a21659799e59ab82bc8d1864a3abe3b6d7 bubbles.2b
REM 2a2c6dd8c2196dcd5e71b38554a56ee03d2aa454 bubbles.3b
REM de4d212cd2967b2dcd7b2c09dea2c1b06ce4c5bd bubbles.4b
REM ae52f8c69c8b821abb458288c8ee0bc6c28fe535 bubbles.5b
REM d55aa8fb8f2974ce5ba7155b01bc3e3622f202af bubbles.6b
REM 2da6213df6c15735a8bbd6750cfb1a1b6232a6f5 bubbles.7b
REM 9d71caa30bc3f4151789279d21651e5a4fe4a484 bubbles.8b
REM 551a49a12353044dbbf28dba2bd860c2d00c50bd bubbles.9b
REM db428e79fc325ae3c8cab460267c27cdbc35a3bd bubbles.10b
REM f0c3a330abf9c8cfb6007ee372409450d2a15a93 bubbles.11b
REM be4b9800c846660ce2b2ddd75ad872dcf174979a bubbles.12b
REM b70d2553f731f9a20ddaf9af2f93b7e9c44d4d99 bubbles.snd

set rom_path_src=..\roms\bubbles
set rom_path_dst=..\build
set romgen_path=..\tools

mkdir %rom_path_dst%
REM generate RAMB structures for larger ROMS

REM soundcpu
%romgen_path%\romgen %rom_path_src%\bubbles.snd  SND_ROM_0F    12 l r e > %rom_path_dst%\SND_ROM_0F.vhd

REM decoders
%romgen_path%\romgen %rom_path_src%\decoder.4    DECODER_4      9 a     > %rom_path_dst%\DEC_4.vhd
%romgen_path%\romgen %rom_path_src%\decoder.6    DECODER_6      9 a     > %rom_path_dst%\DEC_6.vhd

REM maincpu
%romgen_path%\romgen %rom_path_src%\bubbles.10b  CPU_ROM_0D    12 l r e > %rom_path_dst%\CPU_ROM_0D.vhd
%romgen_path%\romgen %rom_path_src%\bubbles.11b  CPU_ROM_0E    12 l r e > %rom_path_dst%\CPU_ROM_0E.vhd
%romgen_path%\romgen %rom_path_src%\bubbles.12b  CPU_ROM_0F    12 l r e > %rom_path_dst%\CPU_ROM_0F.vhd
%romgen_path%\romgen %rom_path_src%\bubbles.1b   CPU_ROM_10    12 l r e > %rom_path_dst%\CPU_ROM_10.vhd
%romgen_path%\romgen %rom_path_src%\bubbles.2b   CPU_ROM_11    12 l r e > %rom_path_dst%\CPU_ROM_11.vhd
%romgen_path%\romgen %rom_path_src%\bubbles.3b   CPU_ROM_12    12 l r e > %rom_path_dst%\CPU_ROM_12.vhd
%romgen_path%\romgen %rom_path_src%\bubbles.4b   CPU_ROM_13    12 l r e > %rom_path_dst%\CPU_ROM_13.vhd
%romgen_path%\romgen %rom_path_src%\bubbles.5b   CPU_ROM_14    12 l r e > %rom_path_dst%\CPU_ROM_14.vhd
%romgen_path%\romgen %rom_path_src%\bubbles.6b   CPU_ROM_15    12 l r e > %rom_path_dst%\CPU_ROM_15.vhd
%romgen_path%\romgen %rom_path_src%\bubbles.7b   CPU_ROM_16    12 l r e > %rom_path_dst%\CPU_ROM_16.vhd
%romgen_path%\romgen %rom_path_src%\bubbles.8b   CPU_ROM_17    12 l r e > %rom_path_dst%\CPU_ROM_17.vhd
%romgen_path%\romgen %rom_path_src%\bubbles.9b   CPU_ROM_18    12 l r e > %rom_path_dst%\CPU_ROM_18.vhd

echo done
pause
